﻿using System;
using System.ComponentModel.DataAnnotations;
using IterationLife.ContentResources.Enums;
using Util;
using Util.Domains.Repositories;

namespace IterationLife.ContentResources.Queries {
    /// <summary>
    /// 内容资源查询实体
    /// </summary>
    public class ContentResourceQuery : QueryEntityBase {
        /// <summary>
        /// 内容资源编号
        /// </summary>
        [Display(Name="内容资源编号")]
        public Guid? ContentResourceId { get; set; }
        /// <summary>
        /// 分类编号
        /// </summary>
        [Display(Name="分类编号")]
        public Guid? CategoriyId { get; set; }
        /// <summary>
        /// 类型
        /// </summary>
        [Display(Name="类型")]
        public ContentResourceType? Type { get; set; }
        
        private string _title = string.Empty;
        /// <summary>
        /// 标题
        /// </summary>
        [Display(Name="标题")]
        public string Title {
            get { return _title == null ? string.Empty : _title.Trim(); }
            set{ _title=value;}
        }
        
        private string _singleBanner = string.Empty;
        /// <summary>
        /// 单封面图
        /// </summary>
        [Display(Name="单封面图")]
        public string SingleBanner {
            get { return _singleBanner == null ? string.Empty : _singleBanner.Trim(); }
            set{ _singleBanner=value;}
        }
        
        private string _multiBanners = string.Empty;
        /// <summary>
        /// 多封面图
        /// </summary>
        [Display(Name="多封面图")]
        public string MultiBanners {
            get { return _multiBanners == null ? string.Empty : _multiBanners.Trim(); }
            set{ _multiBanners=value;}
        }
        
        private string _systemBanners = string.Empty;
        /// <summary>
        /// 系统封面集合
        /// </summary>
        [Display(Name="系统封面集合")]
        public string SystemBanners {
            get { return _systemBanners == null ? string.Empty : _systemBanners.Trim(); }
            set{ _systemBanners=value;}
        }
        /// <summary>
        /// 封面类型
        /// </summary>
        [Display(Name="封面类型")]
        public ContentResourceBannerType? BannerType { get; set; }
        
        private string _richText = string.Empty;
        /// <summary>
        /// 富文本
        /// </summary>
        [Display(Name="富文本")]
        public string RichText {
            get { return _richText == null ? string.Empty : _richText.Trim(); }
            set{ _richText=value;}
        }
        
        private string _video = string.Empty;
        /// <summary>
        /// 视频
        /// </summary>
        [Display(Name="视频")]
        public string Video {
            get { return _video == null ? string.Empty : _video.Trim(); }
            set{ _video=value;}
        }
        
        private string _briefIntroduction = string.Empty;
        /// <summary>
        /// 简介
        /// </summary>
        [Display(Name="简介")]
        public string BriefIntroduction {
            get { return _briefIntroduction == null ? string.Empty : _briefIntroduction.Trim(); }
            set{ _briefIntroduction=value;}
        }
        
        private string _tags = string.Empty;
        /// <summary>
        /// 标签
        /// </summary>
        [Display(Name="标签")]
        public string Tags {
            get { return _tags == null ? string.Empty : _tags.Trim(); }
            set{ _tags=value;}
        }
        /// <summary>
        /// 是否定时发表
        /// </summary>
        [Display(Name="是否定时发表")]
        public bool? IsRegularPublication { get; set; }
        /// <summary>
        /// 起始发表时间
        /// </summary>
        [Display( Name = "起始发表时间" )]
        public DateTime? BeginPublicationTime { get; set; }
        /// <summary>
        /// 结束发表时间
        /// </summary>
        [Display( Name = "结束发表时间" )]
        public DateTime? EndPublicationTime { get; set; }        
        /// <summary>
        /// 状态
        /// </summary>
        [Display(Name="状态")]
        public ContentResourceState? State { get; set; }
        /// <summary>
        /// 起始创建时间
        /// </summary>
        [Display( Name = "起始创建时间" )]
        public DateTime? BeginCreationTime { get; set; }
        /// <summary>
        /// 结束创建时间
        /// </summary>
        [Display( Name = "结束创建时间" )]
        public DateTime? EndCreationTime { get; set; }        
        /// <summary>
        /// 创建人
        /// </summary>
        [Display(Name="创建人")]
        public Guid? CreatorId { get; set; }
        /// <summary>
        /// 起始最后修改时间
        /// </summary>
        [Display( Name = "起始最后修改时间" )]
        public DateTime? BeginLastModificationTime { get; set; }
        /// <summary>
        /// 结束最后修改时间
        /// </summary>
        [Display( Name = "结束最后修改时间" )]
        public DateTime? EndLastModificationTime { get; set; }        
        /// <summary>
        /// 最后修改人
        /// </summary>
        [Display(Name="最后修改人")]
        public Guid? LastModifierId { get; set; }
        
        /// <summary>
        /// 添加描述
        /// </summary>
        protected override void AddDescriptions() {
            base.AddDescriptions();
            AddDescription( "内容资源编号", ContentResourceId );
            AddDescription( "分类编号", CategoriyId );
            AddDescription( "类型", Type );
            AddDescription( "标题", Title );
            AddDescription( "单封面图", SingleBanner );
            AddDescription( "多封面图", MultiBanners );
            AddDescription( "系统封面集合", SystemBanners );
            AddDescription( "封面类型", BannerType );
            AddDescription( "富文本", RichText );
            AddDescription( "视频", Video );
            AddDescription( "简介", BriefIntroduction );
            AddDescription( "标签", Tags );
            AddDescription( "是否定时发表", IsRegularPublication.Description() );
            AddDescription( "起始发表时间", BeginPublicationTime );
            AddDescription( "结束发表时间", EndPublicationTime );
            AddDescription( "状态", State );
            AddDescription( "起始创建时间", BeginCreationTime );
            AddDescription( "结束创建时间", EndCreationTime );
            AddDescription( "创建人", CreatorId );
            AddDescription( "起始最后修改时间", BeginLastModificationTime );
            AddDescription( "结束最后修改时间", EndLastModificationTime );
            AddDescription( "最后修改人", LastModifierId );
        } 
    }
}
